package com.ipan.weixin;

import org.apache.http.HttpEntity;

import com.ipan.weixin.msg.JsonMsg;
import com.ipan.weixin.util.WxHttpUtils;

/**
 * 发送客服消息管理器
 * 
 * @author iPan
 * @version 2013-12-30
 */
public class SendMsgManager {

	public void sendTextMsg(String touser, String content) {
		String url = WxConfiguration.getInstance().getUrlSend();
		String accessToken = AccessTokenManager.getInstance().getAccessToken();
		url = WxConfiguration.fillUrlParam(url, new String[]{accessToken});
		HttpEntity entity = WxHttpUtils.createStringEntity(content, JsonMsg.CONTENT_TYPE);
		WxHttpUtils.post(url, null, entity);
	}
}
